<template>
    <div>
        <div>
            {{name}}--{{id}}--{{msg}}
        </div>
    </div>
</template>

<script>
import { login, } from '@/http/api'
export default {
data() {
    return {
    name:"",
    id:"",
    msg:"",    
    }
},
methods: {
    login(){
    login({ name: 'zhangsan', pwd: '1234' }).then((data) => {
        console.log(data);
        this.msg=data.msg;
        this.name=data.data.name;
        this.id=data.data.id;

    }).catch((err) => {
        console.log(err);
    }); 
    },

},
created() {
    this.login()
},
}
</script>

<style>

</style>
